int LED1 = 9;
int LED2 = 10;

void setup(){
 Serial.begin(9600);
 pinMode(9,OUTPUT);  // pin 9 output
 pinMode(10,OUTPUT); // pin 10 output
 pinMode(11,INPUT);  // pin 11 input

}

void loop(){  
 if(Serial.available()> 0){
    char Read = Serial.read();
    int doorsta = digitalRead(11);
    
       
 switch(Read){
   case 'L':
   if(doorsta == 1 && digitalRead(9) == LOW ){  // State to lock car
   
     digitalWrite(9,HIGH);
     digitalWrite(10,HIGH);
     delay(1000);
     digitalWrite(10,LOW);
     delay(1000);
     break;   
   }
   case 'U':
   if(doorsta == 1 && digitalRead(9)== HIGH){  // state to unlock car
   
      digitalWrite(9,LOW);
      digitalWrite(10,HIGH);
     delay(1000);
     digitalWrite(10,LOW);
     delay(1000);
      digitalWrite(10,HIGH);
     delay(1000);
     digitalWrite(10,LOW);
     delay(1000);
    break; 
   }
   
  }
 }
}
 

 

 
       
           
         

         




